<?php
$this->houseme_view->header();

$temp_question_form_data = $this->session->userdata('temp_question_form_data');
$temp_form_data_title = '';
$temp_form_data_desc = '';

if(!empty($temp_question_form_data)){
  $temp_form_data_title = isset($temp_question_form_data['title'])?$temp_question_form_data['title']:'';
  $temp_form_data_desc = isset($temp_question_form_data['desc'])?$temp_question_form_data['desc']:'';
}

?>

<div id="askcontainer">
        <?php if($this->facebook->checkLoginStatus() || $this->tank_auth->is_fe_logged_in()){ ?>
          
        <?php }else{ ?>
          <div style="text-align:center;font-size:20px;background-color: #801515;color:white;margin-bottom:10px;">友善提醒：要登入會員才能發佈問題喔！</div>
        <?php } ?>
        <div class="askcontainer_l">
        <form method="post" action="/question/create" name="questionForm" id="questionForm" class="hidden-sm hidden-xs">
        <div class="askbox">
           <div class="askcontent01">
               <div class="asktxt">標題</div>
               <div class="askform"><input type="text" name="title" value="<?php echo $temp_form_data_title; ?>"></div>
           </div>
           <div class="askcontent02">
               <div class="asktxt">發問內容</div>
               <div class="askform"><textarea name="desc" id="" cols="30" rows="10"><?php echo $temp_form_data_desc; ?></textarea></div>
           </div>
           <div class="askcontent03">
               <div class="asktxt">投票選項</div>
               <div class="askform">
                   <div class="asktxt2">*建議每個選項提供可讓大家參考的文字or照片資料，以利大家給你意見喔！</div>
                   <div class="uploadbox">
                      <div class="load1" id="votePhotosArea" >
                        <div class="desc_area"><div class="photo_desc" >圖片說明：</div><div class="photo_desc_input"><input style="width:180px;" name="photo_desc[]"/></div></div>
                        <div class="btn1"><input class="votePhotos" type="file" accept="image/*" name="image[]"></div>
                      </div>
                       <div class="bt2_addfoto"><a onclick="addVotePhoto();" href="javascript:;">增加下一張圖片</a></div>
                        <div class="c"></div>
                        <div class="b_send2"><a onclick="initialAjaxQuestionForm();" id="submit_question" href="javascript:;">發 表 提 問</a></div>
                   </div>
               </div>
           </div>
        </div>
        </form>
        <div class="asklist">
          	<?php foreach($question_list as $key=>$val){ ?>
            <div class="alist">
                <div class="alist_foto"><a href="/question/show/<?php echo $val['question_id'];?>"><img src="<?php echo $this->config->item('image_uploader_question_vote_thumbs', 'layout').$val['uid'].'/'.$val['image']; ?>" alt=""></a></div>
                <div class="alist_info">
                    <div class="alist_title"><a href="/question/show/<?php echo $val['question_id'];?>"><?php echo $val['title']; ?></a></div>
                    <div class="alist_btn">
                        <div class="comment">
                            <div class="icon"></div>
                            <div class="num"><?php echo isset($question_comment_counts[$val['question_id']])?$question_comment_counts[$val['question_id']]:'0'; ?></div>
                            <div class="c"></div>
                        </div>
                        <!--<div class="tick">
                           <a href="#">
                            <div class="icon"></div>
                            <div class="num">30</div>
                            <span class="c"></span>
                            </a>
                        </div>
                        -->
                    </div>
                    <div class="alist_peo">
                        <!--<div class="a_peo"><img src="images/ask/ex_40x40.jpg" alt=""></div>-->
                        <div class="a_name">
                            <div class="name">提問人:<?php echo !empty($val['name'])?$val['name']:$val['email'];?></div>
                            <div class="time"><?php echo date('Y/m/d',strtotime($val['create_time'])); ?></div>
                            <div class="c"></div>
                        </div>
                    </div>
                </div>
                <div class="c"></div>
            </div>
            <?php } ?>
        </div>
        </div>
        <!--
        <div class="askcontainer_r">
           <div class="ask_choose">
               <div class="title">文章選擇</div>
               <ul>
                   <li><a href="#">選擇一</a></li>
                   <li><a class="select" href="#">選擇一</a></li>
                   <li><a href="#">選擇一</a></li>
                   <li><a href="#">選擇一</a></li>
               </ul>
           </div>
           <div class="ask_populer">
               <div class="title">受歡迎的文章</div>
               <ul>
                <li>
                      <div class="foto"><img src="images/ask/ex_100x100.jpg" alt=""></div>
                      <div class="txt">
                          <h1>不知道該選哪個壁紙?</h1>
                          <span>假字假字假字假字假字假字假字假字假字</span>
                          <div class="name">nacy</div>
                          <div class="cicon"><a href="#">30</a></div>
                      </div>
                      <div class="c"></div>
                  </li>
                     <li>
                      <div class="foto"><img src="images/ask/ex_100x100.jpg" alt=""></div>
                      <div class="txt">
                          <h1>不知道該選哪個壁紙?</h1>
                          <span>假字假字假字假字假字假字假字假字假字</span>
                          <div class="name">nacy</div>
                          <div class="cicon"><a href="#">30</a></div>
                      </div>
                      <div class="c"></div>
                  </li>
                  <li>
                      <div class="foto"><img src="images/ask/ex_100x100.jpg" alt=""></div>
                      <div class="txt">
                          <h1>不知道該選哪個壁紙?</h1>
                          <span>假字假字假字假字假字假字假字假字假字</span>
                          <div class="name">nacy</div>
                          <div class="cicon"><a href="#">30</a></div>
                      </div>
                      <div class="c"></div>
                  </li>
               </ul>
           </div>
            
        </div>
        -->
        <div class="c"></div>
    </div>

<?php
$this->houseme_view->footer();
?>